<?php 

// var_dump($_POST);

$users=include_once './user.php';

// var_dump($users);
session_start();  

foreach ($users as $user) {
	if($user['username']==$_POST['username']){   
		if($user['password']==md5($_POST['password'])){  //md5就是把字符串加密
			session_start();
			$_SESSION['username']=$user['username'];
			$_SESSION['nikename']=$user['nikename'];
			success('你登录成功','./index.php');
			exit;
		}

	}
}
 echo '帐号或者密码错误';


 ?>